package com.example.controller;

import com.example.pojo.aboutMajors.Majors;
import com.example.pojo.aboutSchool.Schools;
import com.example.service.General2Service;
import com.example.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/general2")
public class General2Controller {

    @Autowired
    private General2Service generalService;

    @PostMapping("/getCollegeList")
    public Result getCollegeList(@RequestBody Map<String, Object> params) {
        List<Schools> result = generalService.getCollegeList(params);
        return Result.success(result);
    }

    @PostMapping("/getMajorList")
    public Result getMajorList(@RequestBody Map<String, Object> params) {
        List<Majors> result = generalService.getMajorList(params);
        return Result.success(result);
    }

    @PostMapping("/getCollegeMajors")
    public Result getCollegeMajors(@RequestBody Map<String, Object> params) {
        List<Majors> result = generalService.getCollegeMajors(params);
        return Result.success(result);
    }

    @PostMapping("/getMajorColleges")
    public Result getMajorColleges(@RequestBody Map<String, Object> params) {
        List<Schools> result = generalService.getMajorColleges(params);
        return Result.success(result);
    }
}
